<template>
  <el-table
    :data="tableData"
    border
    stripe
    style="width: 100%">
    <el-table-column
      prop="createTime"
      label="日期"
      width="180">
    </el-table-column>
    <el-table-column
      prop="name"
      label="姓名"
      width="180">
    </el-table-column>
    <el-table-column
      prop="address"
      label="地址">
    </el-table-column>
  </el-table>
</template>

<script>
  //import userMock from "../../mock/user"  //引入mockjs
  //import axios from "axios"  //引入axios
export default {
  name: 'User',
  /**/
  data () {
    return {
      tableData: []
    }
  },
  mounted(){
    //使用axios代替ajax发送ajax请求
    //https://www.fastmock.site/mock/055a7165663dee27d853c64d68b8bf8b/pethome
    this.$http.post("/dept/list",{"currentPage":1})
      .then(result=>{
         result =  result.data;
        this.tableData  = result.rows;
      })
      .catch(result=>{//前台无法调通后台
        alert("系统错误！！")
      })
  }
}
</script>
<style scoped>
</style>
